<?php

class Administrator extends BackendAppModel {
	
	var $name = 'Administrator';
	
	var $validate  = array('username'=>VALID_NOT_EMPTY,'email'=>array(array('rule'=>'email','message'=>'Enter a valid email'),array('rule'=>'unique','message'=>'Email already exists')));

	var $useTable = false; // @todo Remove later when needed
	
	function beforeSave($options)
	{
		if(!isset($this->data['Administrator']['id']) && !$this->id)
		{
			uses('string');
			$this->data['Administrator']['validateCode'] = String::uuid();
		}
		return parent::beforeSave($options);
	}
}
?>